package cn.assumejson.springframework.beans.factory.support;

import cn.assumejson.springframework.beans.factory.BeanFactory;
import cn.assumejson.springframework.beans.factory.BeansException;
import cn.assumejson.springframework.beans.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

/**
 * 实例化策略接口
 * 分为 JDK、cglib
 *
 * @author Mr. Li
 * @version 1.0
 * @since 1.0 2021/11/30 8:44
 */
public interface InstantiationStrategy {

    Object instantiate(RootBeanDefinition bd, String beanName)
            throws BeansException, ClassNotFoundException;

    Object instantiate(RootBeanDefinition bd, String beanName,
                       Constructor<?> ctor, Object... args) throws BeansException, ClassNotFoundException;
}
